<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get the Unicode name for a property</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="intlchar.getpropertyenum.html">« IntlChar::getPropertyEnum</a></li>
      <li style="float: right;"><a href="intlchar.getpropertyvalueenum.html">IntlChar::getPropertyValueEnum »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.intlchar.html">IntlChar</a></li>
    <li>Get the Unicode name for a property</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="intlchar.getpropertyname" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlChar::getPropertyName</h1>
  <p class="verinfo">(PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">IntlChar::getPropertyName</span> &mdash; <span class="dc-title">Get the Unicode name for a property</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlchar.getpropertyname-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>IntlChar::getPropertyName</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$property</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$type</code><span class="initializer"> = IntlChar::LONG_PROPERTY_NAME</span></span>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   Returns the Unicode name for a given property, as given in the Unicode database file PropertyAliases.txt.
  </p>
  <p class="para">
   In addition, this function maps the property <strong><code>IntlChar::PROPERTY_GENERAL_CATEGORY_MASK</code></strong> to the
   synthetic names &quot;gcm&quot; / &quot;General_Category_Mask&quot;. These names are not in PropertyAliases.txt.
  </p>
  <p class="para">
   This function complements <span class="function"><a href="intlchar.getpropertyenum.html" class="function">IntlChar::getPropertyEnum()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlchar.getpropertyname-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">property</code></dt>

    <dd>

     <p class="para">The Unicode property to lookup (see the <code class="literal">IntlChar::PROPERTY_*</code> constants).</p>
     <p class="para">
      <strong><code>IntlChar::PROPERTY_INVALID_CODE</code></strong> should not be used.
      Also, if <code class="parameter">property</code> is out of range, <strong><code>false</code></strong> is returned.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">type</code></dt>

    <dd>

     <p class="para">
      Selector for which name to get. If out of range, <strong><code>false</code></strong> is returned.
     </p>
     <p class="para">
      All properties have a long name. Most have a short name, but some do not. Unicode allows for additional names;
      if present these will be returned by adding 1, 2, etc. to <strong><code>IntlChar::LONG_PROPERTY_NAME</code></strong>.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlchar.getpropertyname-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the name, or <strong><code>false</code></strong> if either the <code class="parameter">property</code> or the <code class="parameter">type</code>
   is out of range.
  </p>
  <p class="para">
   If a given <code class="parameter">type</code> returns <strong><code>false</code></strong>, then all larger values of
   <code class="parameter">type</code> will return <strong><code>false</code></strong>, with one exception: if <strong><code>false</code></strong> is returned for
   <strong><code>IntlChar::SHORT_PROPERTY_NAME</code></strong>, then <strong><code>IntlChar::LONG_PROPERTY_NAME</code></strong>
   (and higher) may still return a non-<strong><code>false</code></strong> value.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-intlchar.getpropertyname-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-2510">
   <p><strong>示例 #1 Testing different properties</strong></p>
   <div class="example-contents">
    <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">getPropertyName</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">PROPERTY_BIDI_CLASS</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">getPropertyName</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">PROPERTY_BIDI_CLASS</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">SHORT_PROPERTY_NAME</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">getPropertyName</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">PROPERTY_BIDI_CLASS</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">LONG_PROPERTY_NAME</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">getPropertyName</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">PROPERTY_BIDI_CLASS</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">LONG_PROPERTY_NAME&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
    <div class="cdata"><pre>
string(10) &quot;Bidi_Class&quot;
string(2) &quot;bc&quot;
string(10) &quot;Bidi_Class&quot;
bool(false)
</pre></div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-intlchar.getpropertyname-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="intlchar.getpropertyenum.html" class="function" rel="rdfs-seeAlso">IntlChar::getPropertyEnum()</a> - Get the property constant value for a given property name</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>